package com.zhanghe.study.hdfs;

import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FileSystem;

import java.io.IOException;

/**
 * @author zh
 * @date 2022/5/14 09:23
 */
public class LocalHdfs {
    public static void main(String[] args) throws IOException {
        Configuration conf = new Configuration();
        conf.set("fs.defaultFS","file:///Users/zhanghe/Desktop");
        // 获取hdfs客户端对象
        FileSystem fs = FileSystem.get(conf);
        System.out.println(fs.getHomeDirectory().getName());
        fs.close();

    }
}
